<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="../../../style.css" type="text/css" media="screen">
<link rel="stylesheet" href="../../../print.css" type="text/css" media="print">
<meta content="RESTfulActiveResourceManager,com.badrit.restarm.RESTfulActiveResourceManager,afterCreateHandler,autoSave,sortable,baseURL,addListFailedHandler,addListLoadedHandler,attachToCollection,commit,refreshList,removeListFailedHandler,removeListLoadedHandler,show,update" name="keywords">
<title>com.badrit.restarm.RESTfulActiveResourceManager</title>
</head>
<body>
<script type="text/javascript" language="javascript" src="../../../asdoc.js"></script><script type="text/javascript" language="javascript" src="../../../cookies.js"></script><script type="text/javascript" language="javascript">
<!--
				asdocTitle = 'RESTfulActiveResourceManager - API Documentation';
				var baseRef = '../../../';
				window.onload = configPage;
			--></script>
<table style="display:none" id="titleTable" cellspacing="0" cellpadding="0" class="titleTable">
<tr>
<td align="left" class="titleTableTitle">API Documentation</td><td align="right" class="titleTableTopNav"><a onclick="loadClassListFrame('../../../all-classes.html')" href="../../../package-summary.html">All&nbsp;Packages</a>&nbsp;|&nbsp;<a onclick="loadClassListFrame('../../../all-classes.html')" href="../../../class-summary.html">All&nbsp;Classes</a>&nbsp;|&nbsp;<a onclick="loadClassListFrame('../../../index-list.html')" href="../../../all-index-A.html">Index</a>&nbsp;|&nbsp;<a href="../../../index.html?com/badrit/restarm/RESTfulActiveResourceManager.html&amp;com/badrit/restarm/class-list.html" id="framesLink1">Frames</a><a onclick="parent.location=document.location" href="" style="display:none" id="noFramesLink1">No&nbsp;Frames</a></td><td rowspan="3" align="right" class="titleTableLogo"><img alt="Adobe Logo" title="Adobe Logo" class="logoImage" src="../../../images/logo.jpg"></td>
</tr>
<tr class="titleTableRow2">
<td align="left" id="subTitle" class="titleTableSubTitle">Class&nbsp;RESTfulActiveResourceManager</td><td align="right" id="subNav" class="titleTableSubNav"><a href="#propertySummary">Properties</a>&nbsp;| <a href="#methodSummary">Methods</a></td>
</tr>
<tr class="titleTableRow3">
<td colspan="2">&nbsp;</td>
</tr>
</table>
<script type="text/javascript" language="javascript">
<!--
if (!isEclipse() || window.name != ECLIPSE_FRAME_NAME) {titleBar_setSubTitle("Class RESTfulActiveResourceManager"); titleBar_setSubNav(false,true,false,false,false,false,true,false,false,false,false,false,false,false);}
--></script>
<div class="MainContent">
<table cellspacing="0" cellpadding="0" class="classHeaderTable">
<tr>
<td class="classHeaderTableLabel">Package</td><td><a onclick="javascript:loadClassListFrame('class-list.html')" href="package-detail.html">com.badrit.restarm</a></td>
</tr>
<tr>
<td class="classHeaderTableLabel">Class</td><td class="classSignature">public class RESTfulActiveResourceManager</td>
</tr>
</table>
<p></p>
  Class that provides Restfull actions (Create\Edit\List\Delete) to a Restfull back end  
  <p></p>
<br>
<hr>
</div>
<a name="propertySummary"></a>
<div class="summarySection">
<div class="summaryTableTitle">Public Properties</div>
<table id="summaryTableProperty" class="summaryTable " cellpadding="3" cellspacing="0">
<tr>
<th>&nbsp;</th><th colspan="2">Property</th><th class="summaryTableOwnerCol">Defined&nbsp;by</th>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><a class="signatureLink" href="#afterCreateHandler">afterCreateHandler</a> : Function = null<div class="summaryTableDescription">
   A callback that need to be called after creation of each resource
   </div>
</td><td class="summaryTableOwnerCol">RESTfulActiveResourceManager</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><a class="signatureLink" href="#autoSave">autoSave</a> : Boolean = false<div class="summaryTableDescription">
   Whether new resources are automatically saved to database or not.</div>
</td><td class="summaryTableOwnerCol">RESTfulActiveResourceManager</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><a class="signatureLink" href="#baseURL">baseURL</a> : String<div class="summaryTableDescription">[write-only]
   Sets the base URL under which this resource is located
   </div>
</td><td class="summaryTableOwnerCol">RESTfulActiveResourceManager</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><a class="signatureLink" href="#sortable">sortable</a> : Boolean = false<div class="summaryTableDescription">
   Whether this resource needs to be sorted or not.</div>
</td><td class="summaryTableOwnerCol">RESTfulActiveResourceManager</td>
</tr>
</table>
</div>
<a name="methodSummary"></a>
<div class="summarySection">
<div class="summaryTableTitle">Public Methods</div>
<table id="summaryTableMethod" class="summaryTable " cellpadding="3" cellspacing="0">
<tr>
<th>&nbsp;</th><th colspan="2">Method</th><th class="summaryTableOwnerCol">Defined&nbsp;by</th>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#RESTfulActiveResourceManager()">RESTfulActiveResourceManager</a>()</div>
<div class="summaryTableDescription">
   Creates a new REST client
   </div>
</td><td class="summaryTableOwnerCol">RESTfulActiveResourceManager</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#addListFailedHandler()">addListFailedHandler</a>(failedCallback:Function):void</div>
<div class="summaryTableDescription">
   Add a handler to the list of list load failed handlers.</div>
</td><td class="summaryTableOwnerCol">RESTfulActiveResourceManager</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#addListLoadedHandler()">addListLoadedHandler</a>(handler:Function):void</div>
<div class="summaryTableDescription">
   Add a handler to the list of list loaded handlers.</div>
</td><td class="summaryTableOwnerCol">RESTfulActiveResourceManager</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#attachToCollection()">attachToCollection</a>(collection:ListCollectionView, converter:<a href="IRESTfulActiveResource.html">IRESTfulActiveResource</a>, resourceName:String, autoFill:Boolean = true):void</div>
<div class="summaryTableDescription">
   Attaches this resource manager to a collection of items.</div>
</td><td class="summaryTableOwnerCol">RESTfulActiveResourceManager</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#commit()">commit</a>(callback:Function = null):void</div>
<div class="summaryTableDescription">
   Commit all changes to the database
   </div>
</td><td class="summaryTableOwnerCol">RESTfulActiveResourceManager</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#refreshList()">refreshList</a>(loadedCallback:Function = null, failedCallback:Function = null):void</div>
<div class="summaryTableDescription">
   Refresh the list from database and update it to the collection attached
   </div>
</td><td class="summaryTableOwnerCol">RESTfulActiveResourceManager</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#removeListFailedHandler()">removeListFailedHandler</a>(handler:Function):void</div>
<div class="summaryTableDescription">
   Remove a handler that was previously added using #addListFailedHandler(Function)
   This will cause this handler to stop receiving events when the list is reloaded
   </div>
</td><td class="summaryTableOwnerCol">RESTfulActiveResourceManager</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#removeListLoadedHandler()">removeListLoadedHandler</a>(handler:Function):void</div>
<div class="summaryTableDescription">
   Remove a handler that was previously added using #addListLoadedHandler(Function)
   This will cause this handler to stop receiving events when the list is reloaded
   </div>
</td><td class="summaryTableOwnerCol">RESTfulActiveResourceManager</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#show()">show</a>(id:Number, resultHandler:Function = null, faultHandler:Function = null):AsyncToken</div>
<div class="summaryTableDescription">
   Gets the detailed information of one resource from the server
   URL: <base_url>/<resource>s/id.xml
   METHOD: get
   </div>
</td><td class="summaryTableOwnerCol">RESTfulActiveResourceManager</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#update()">update</a>(remoteObj:Object, resultHandler:Function = null, faultHandler:Function = null):AsyncToken</div>
<div class="summaryTableDescription">
   Updates the given resource in the database
   </div>
</td><td class="summaryTableOwnerCol">RESTfulActiveResourceManager</td>
</tr>
</table>
</div>
<script type="text/javascript" language="javascript">
<!--
showHideInherited();
--></script>
<div class="MainContent">
<a name="propertyDetail"></a>
<div class="detailSectionHeader">Property detail</div>
<a name="afterCreateHandler"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">afterCreateHandler</td><td class="detailHeaderType">property</td>
</tr>
</table>
<div class="detailBody">
<code>public var afterCreateHandler:Function = null</code><p>
   A callback that need to be called after creation of each resource
   </p></div>
<a name="autoSave"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">autoSave</td><td class="detailHeaderType">property</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public var autoSave:Boolean = false</code><p>
   Whether new resources are automatically saved to database or not.
   The default is false, so the commit should be done by the user to save 
   the resources chages to database.
   
   </p><p>The default value is <code>false</code>.</p>
</div>
<a name="baseURL"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">baseURL</td><td class="detailHeaderType">property</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>baseURL:String</code>&nbsp;&nbsp;[write-only]<p>
   Sets the base URL under which this resource is located
   </p><span class="label">Implementation</span>
<br>
<code>&nbsp;&nbsp;&nbsp;&nbsp;public function set baseURL(value:String):void</code>
<br>
</div>
<a name="sortable"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">sortable</td><td class="detailHeaderType">property</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public var sortable:Boolean = false</code><p>
   Whether this resource needs to be sorted or not.
   This requires the backend to implement the sort action which accepts
   a comma-separated list of ids to sort.
   
   </p><p>The default value is <code>false</code>.</p>
</div>
<a name="constructorDetail"></a>
<div class="detailSectionHeader">Constructor detail</div>
<a name="RESTfulActiveResourceManager()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">RESTfulActiveResourceManager</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">constructor</td>
</tr>
</table>
<div class="detailBody">
<code>public function RESTfulActiveResourceManager()</code><p>
   Creates a new REST client
   </p></div>
<a name="methodDetail"></a>
<div class="detailSectionHeader">Method detail</div>
<a name="addListFailedHandler()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">addListFailedHandler</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td>
</tr>
</table>
<div class="detailBody">
<code>public function addListFailedHandler(failedCallback:Function):void</code><p>
   Add a handler to the list of list load failed handlers.
   Functions in this list will be notified when the list of objects
   is failed to load from server.
   </p><span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">failedCallback</span>:Function</code></td>
</tr>
</table>
</div>
<a name="addListLoadedHandler()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">addListLoadedHandler</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public function addListLoadedHandler(handler:Function):void</code><p>
   Add a handler to the list of list loaded handlers.
   Functions in this list will be notified when the list of objects
   is loaded completely from server.
   This may be useful when there are other resources that depend on
   instances of the resources attached to this manager.
   </p><span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">handler</span>:Function</code></td>
</tr>
</table>
</div>
<a name="attachToCollection()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">attachToCollection</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public function attachToCollection(collection:ListCollectionView, converter:<a href="IRESTfulActiveResource.html">IRESTfulActiveResource</a>, resourceName:String, autoFill:Boolean = true):void</code><p>
   Attaches this resource manager to a collection of items.
   This collection of items is updated elsewhere in the code.
   This ActiveResourceManager should listen to changes to this collection and
   updates the BackEnd when this collection changes.
   </p><span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">collection</span>:ListCollectionView</code></td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">converter</span>:<a href="IRESTfulActiveResource.html">IRESTfulActiveResource</a></code></td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">resourceName</span>:String</code></td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">autoFill</span>:Boolean</code> (default = <code>true</code>)<code></code></td>
</tr>
</table>
</div>
<a name="commit()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">commit</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public function commit(callback:Function = null):void</code><p>
   Commit all changes to the database
   </p><span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">callback</span>:Function</code> (default = <code>null</code>)<code></code></td>
</tr>
</table>
</div>
<a name="refreshList()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">refreshList</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public function refreshList(loadedCallback:Function = null, failedCallback:Function = null):void</code><p>
   Refresh the list from database and update it to the collection attached
   </p><span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">loadedCallback</span>:Function</code> (default = <code>null</code>)<code></code></td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">failedCallback</span>:Function</code> (default = <code>null</code>)<code></code></td>
</tr>
</table>
</div>
<a name="removeListFailedHandler()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">removeListFailedHandler</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public function removeListFailedHandler(handler:Function):void</code><p>
   Remove a handler that was previously added using #addListFailedHandler(Function)
   This will cause this handler to stop receiving events when the list is reloaded
   </p><span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">handler</span>:Function</code></td>
</tr>
</table>
</div>
<a name="removeListLoadedHandler()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">removeListLoadedHandler</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public function removeListLoadedHandler(handler:Function):void</code><p>
   Remove a handler that was previously added using #addListLoadedHandler(Function)
   This will cause this handler to stop receiving events when the list is reloaded
   </p><span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">handler</span>:Function</code></td>
</tr>
</table>
</div>
<a name="show()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">show</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public function show(id:Number, resultHandler:Function = null, faultHandler:Function = null):AsyncToken</code><p>
   Gets the detailed information of one resource from the server
   URL: <base_url>/<resource>s/id.xml
   METHOD: get
   </p><span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">id</span>:Number</code></td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">resultHandler</span>:Function</code> (default = <code>null</code>)<code></code></td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">faultHandler</span>:Function</code> (default = <code>null</code>)<code></code></td>
</tr>
</table>
<p></p>
<span class="label">Returns</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20"></td><td><code>AsyncToken</code></td>
</tr>
</table>
</div>
<a name="update()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">update</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public function update(remoteObj:Object, resultHandler:Function = null, faultHandler:Function = null):AsyncToken</code><p>
   Updates the given resource in the database
   </p><span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">remoteObj</span>:Object</code></td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">resultHandler</span>:Function</code> (default = <code>null</code>)<code></code></td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">faultHandler</span>:Function</code> (default = <code>null</code>)<code></code></td>
</tr>
</table>
<p></p>
<span class="label">Returns</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20"></td><td><code>AsyncToken</code></td>
</tr>
</table>
</div>
<br>
<br>
<hr>
<br>
<p></p>
<center class="copyright"> 
</center>
</div>
</body>
</html>
<!-- -->
